﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using Repository;

namespace Manager
{
    public class CompanyManager : ICompanyManager
    {
        public IRepository<Company> CompanyRepository { get; set; }

        public object Save(Company entity)
        {
            return this.CompanyRepository.Save(entity);
        }

        public void Delete(object id)
        {
            this.CompanyRepository.Delete(this.Get(id));
        }

        public Company Get(object id)
        {
            return this.CompanyRepository.Get(id);
        }

        public void Update(Company entity)
        {
            Company company = this.Get(entity.CompanyID);
            company.CompanyName = entity.CompanyName;
            this.CompanyRepository.Update(company);
        }
    }
}
